Skip to content

test: replace removed CliRunner.isolated_filesystem with tmp_path#703

Merged
jirhiker merged 2 commits into
stagingfrom
fix/cli-test-isolated-filesystem
Jun 8, 2026
Merged

test: replace removed CliRunner.isolated_filesystem with tmp_path#703
jirhiker merged 2 commits into
stagingfrom
fix/cli-test-isolated-filesystem

Conversation

@jirhiker

@jirhiker jirhiker commented Jun 8, 2026

Copy link
Copy Markdown
Member

Why

  • test_associate_assets_command_calls_service fails:
    AttributeError: 'CliRunner' object has no attribute 'isolated_filesystem'
  • Click's CliRunner dropped the isolated_filesystem() context manager in the version now resolved.

How

  • Use the pytest tmp_path fixture to create the asset_import_batch dir, matching the pattern other tests in this file already use (tests/test_cli_commands.py:257).
  • Black additionally normalized one unrelated textwrap.dedent block in test_water_levels_cli_persists_observations (pre-existing format drift the pre-commit hook fixed).

Notes

  • Local run still blocked by Postgres auth in dev .env; CI exercises it.

Click's CliRunner dropped the isolated_filesystem() context manager in
the version now resolved, so test_associate_assets_command_calls_service
failed with AttributeError. Replace it with the pytest tmp_path fixture,
matching the pattern used by other tests in this file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CLI command test suite to accommodate a Click/Typer upgrade where CliRunner.isolated_filesystem() is no longer available, ensuring associate-assets tests continue to run reliably.

Changes:

  • Replaced use of CliRunner.isolated_filesystem() with pytest’s tmp_path fixture in test_associate_assets_command_calls_service.
  • Creates the expected asset_import_batch directory under tmp_path before invoking the CLI command.

@jirhiker jirhiker merged commit 46ca905 into staging Jun 8, 2026
3 checks passed
@jirhiker jirhiker deleted the fix/cli-test-isolated-filesystem branch June 8, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants